package com.ys.nms.module.business.dal.mysql.ipv4Mac;

import java.util.*;

import com.ys.nms.framework.common.pojo.PageResult;
import com.ys.nms.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ys.nms.framework.mybatis.core.mapper.BaseMapperX;
import com.ys.nms.module.business.dal.dataobject.ipv4Mac.Ipv4MacDO;
import org.apache.ibatis.annotations.Mapper;
import com.ys.nms.module.business.controller.admin.ipv4Mac.vo.*;

/**
 * IPMAC Mapper
 *
 * @author zzy
 */
@Mapper
public interface Ipv4MacMapper extends BaseMapperX<Ipv4MacDO> {

    default PageResult<Ipv4MacDO> selectPage(Ipv4MacPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<Ipv4MacDO>()
                .eqIfPresent(Ipv4MacDO::getPortId, reqVO.getPortId())
                .eq(Ipv4MacDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(Ipv4MacDO::getMacAddress, reqVO.getMacAddress())
                .eqIfPresent(Ipv4MacDO::getIpv4Address, reqVO.getIpv4Address())
                .orderByDesc(Ipv4MacDO::getId));
    }

}